package cn.z2huo.demo.mapstruct.dao.user;

import cn.z2huo.demo.mapstruct.dataobject.UserDO;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * @author z2huo
 */
@Repository
public class UserDAO {

    public UserDO getUserByCode(String userCode) {
        return new UserDO().setUserCode(userCode)
                .setUserName("userName " + RandomStringUtils.randomAlphabetic(4))
                .setValidFlag("1")
                .setValidDate(LocalDate.now().plusMonths(-12))
                .setCreateTime(LocalDateTime.now());
    }

}
